package com.woniu.cloud.api;

import com.woniu.cloud.common.dto.Result;
import com.woniu.cloud.form.CouponForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "marketing",contextId = "MarketingAPI")
public interface MarketingApi {


    /***
     * 优惠券
     * @param conponId 优惠id
     * @return data为success/fail
     */
    @GetMapping("getCouponByConponId")
    Result getCouponByConponId(@RequestParam("conponId") Integer conponId);

    /***
     * 新增一类优惠券
     * @param coupon 优惠券表前端传参数据对象
     * @return data为success/fail
     */
    @PostMapping("insertCoupon")
    Result insertCoupon(@RequestBody CouponForm coupon);

    @GetMapping("/getCouponByPrice")
    Result getCouponByPrice(@RequestParam("price") Double price);
    /***
     * 优惠券 删除优惠券
     * @param conponId 优惠id
     * @return data为success/fail
     */
    @DeleteMapping("deleteCouponByConponId")
    Result deleteCouponByConponId(@RequestParam("conponId") Integer conponId);


}
